local Director <const> = require("Director")
local Content <const> = require("Content")
local Path <const> = require("Path")
local DB <const> = require("DB")
local Config <const> = require("Config")

local dbPath = Path(Content.writablePath, "story.db")
DB:exec("ATTACH DATABASE '" .. dbPath .. "' AS story;")
Director.entry:onCleanup(function()
	DB:exec("DETACH DATABASE story")
end)

local conf = Config(
"story",
"charName",
"chapter",
"level",
"bridgeLength",
"cultivation",
"maxCultivation",
"health",
"spiritStone",
"faction",
"year",
"month",
"day",
"dailyInteractTimes",
"favor_MurongXue",
"favor_SuMucheng",
"favor_LinWaner",
"favor_XiaoTiance",
"favor_ZhaoWudi",
"favor_WangBufan",
"favor_ChenXuanji",
"currentNPC",
"favor_currentNPC",
"practiceGain",
"cultivationGain",
"monsterLevel",
"monsterBridge",
"monsterHealth",
"cultivationReward",
"stoneReward",
"healthLoss",
"practiceTimes",
"fightTimes",
"interactTimes",

"gold",
"name")















conf:load()

if not conf.chapter then
	conf.chapter = "start"
end

return conf